package com.myapp.ruyixing.ui;

import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AdapterView.OnItemClickListener;

public class MyOrderMenuFragment extends ListFragment implements
		OnItemClickListener {

	private String[] items = new String[] { "商户预定", "会员卡认领", "积分兑换", "优惠报名",
			"票务预定" };
	private String[] itemTypes = new String[] { "shoporder", "cardorder",
			"scoreorder", "discountorder", "ticketorder" };

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);

		setListAdapter(new ArrayAdapter<String>(getActivity(),
				android.R.layout.simple_list_item_1, items));
		getListView().setOnItemClickListener(this);
	}

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position,
			long id) {
		((OrderActivity) getActivity()).changeType(itemTypes[position],
				items[position]);
	}
}
